﻿<Grid x:Class="httpExplorer.Xaml.SettingsNetwork"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:Xaml="clr-namespace:httpExplorer.Xaml" xmlns:System="clr-namespace:System;assembly=mscorlib"
        DataContext="{Binding NetworkSettingsViewModel, Source={StaticResource Locator}}">
    <Grid.RowDefinitions>
        <RowDefinition Height="auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>

    <StackPanel Grid.Row="0" Grid.Column="0">
        <Xaml:GroupHeader Text="Proxy" />
        <RadioButton GroupName="ProxyGroup" Content="Do not use a proxy" IsChecked="{Binding IsProxyDisable}" Margin="8,8,8,0"/>
        <RadioButton GroupName="ProxyGroup" Content="Use system settings" IsChecked="{Binding IsProxySystem}"  Margin="8,8,8,0"/>
        <RadioButton GroupName="ProxyGroup" Content="Use custom settings:" IsChecked="{Binding IsProxyCustom}"  Margin="8,8,8,0"/>
        <StackPanel IsEnabled="{Binding IsProxyCustom}" >
            <Grid  Margin="20,8,8,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="40" />
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" Content="Proxy Address:" />
                <TextBox Text="{Binding ProxyAddress}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="0,2,0,0"></TextBox>
                <Label Grid.Column="2" Content="Port:" />
                <TextBox Text="{Binding ProxyPort}" Grid.Column="3"  Margin="0,2,0,0"></TextBox>
            </Grid>
            <CheckBox Content="Use Proxy Authentication" Margin="22,8,0,0" IsChecked="{Binding UseProxyAuthentication}"/>
            <StackPanel IsEnabled="{Binding UseProxyAuthentication}" >
                <RadioButton GroupName="AuthenticationGroup" Content="Use login credentials" IsChecked="{Binding IsProxyAuthenticationLogin}"  Margin="40,8,8,0"/>
                <RadioButton GroupName="AuthenticationGroup" Content="Use custom credentials:" IsChecked="{Binding IsProxyAuthenticationBasic}"   Margin="40,8,8,0"/>
                <Grid  Margin="60,8,8,0" IsEnabled="{Binding IsProxyAuthenticationBasic}"  >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Label Grid.Row="0" Grid.Column="0" Content="Username:" />
                    <TextBox  Text="{Binding ProxyUsername}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" Margin="0,2,0,0"></TextBox>
                    <Label Grid.Row="1" Grid.Column="0" Content="Password:" />
                    <TextBox Text="{Binding ProxyPassword}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" Margin="0,2,0,0"></TextBox>
                    <Label Grid.Row="2" Grid.Column="0" Content="Domain:" />
                    <TextBox Text="{Binding ProxyDomain}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" Margin="0,2,0,0"></TextBox>
                </Grid>
            </StackPanel>
        </StackPanel>
    </StackPanel>
</Grid>
